home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!hpl3sn03.cern.ch
- From: Dan Pop <danpop@mail.cern.ch>
- Newsgroups: comp.lang.c
- Subject: Re: Unbuffered character input...
- Date: Tue, 6 Feb 1996 18:01:46 +0100
- Organization: CERN European Lab for Particle Physics
- Message-ID: <9602061701.AA21789@dxmint.cern.ch>
- References: <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu> <4elf0t$5vd@ixnews2.ix.netcom.com> <4ep3a1$bee@hacgate2.hac.com> <DM2zCI.379@emr1.emr.ca> <9602011208.AA06949@dxmint.cern.ch> <4etiup$fig@airdmhor.gen.nz> <9602022043.AA13287@dxmint.cern.ch> <4f7hlf$87n@airdmhor.gen.nz>
- X-NNTP-Posting-Host: hpl3sn03.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
- X-Mail2News-Path: dxmint.cern.ch!hpl3sn03.cern.ch
-
- gumboot@airdmhor.gen.nz (Simon Hosie) writes:
-
- >gumboot@airdmhor.gen.nz (Simon Hosie) writes:
- >> What is the advantage of line buffering user input, anyway?
- >
- >Dan Pop:
- >> 1. It optimizes the cpu time spent on terminal I/O. Not an issue on a
- >> DOS box, but quite important on systems with hundreds of terminals.
- >
- > Line buffering tends to be a function of the terminal rather than the
- >(significant) processor, then?
-
- One some systems, it is a function of the terminal, indeed.
-
- But even on systems where it is not, it still saves processor time.
- The cpu overhead of making a single OS call to get a complete line of input
- is smaller (sometimes significantly smaller) than the overhead of making
- N OS calls, one for each character of the line. The stdio library tries
- to do its best to minimize the number of (expensive) OS calls.
-
- On MSDOS the OS calls are cheap, but on more sophisticated operating
- systems they (usually) aren't, because they involve a transition from
- user mode to kernel mode and back to user mode.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-